<template>
  <div class="stat-container">
    <!-- 新增状态面板 -->
    <parking-status />

    <el-card shadow="never">
      <template #header>
        <div class="chart-header">
          <span>入库时段统计</span>
          <div class="update-time">
            最后更新: {{ new Date().toLocaleTimeString() }}
          </div>
        </div>
      </template>
      <hourly-chart />
    </el-card>
  </div>
</template>

<script setup>
import HourlyChart from '@/components/HourlyChart.vue'
import ParkingStatus from '@/components/ParkingStatus.vue'
</script>

<style scoped>
.stat-container {
  padding: 20px;
  background: #f5f7fa;
  min-height: calc(100vh - 60px);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.update-time {
  font-size: 12px;
  color: #909399;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .stat-container {
    padding: 10px;
  }

  .chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}
</style>
